<h2>Why is this an issue?</h2>
<p>TypeScript provides enums to allow developers to define a set of named constants under a common type. These enum constants can be assigned values,
but it is not mandatory to assign all of them. Those that are not assigned get default values in increasing order starting from zero. As a result,
assigning only a subset of enum members can be misleading. For numeric enums in particular, that would create a gap in the numerical order, which
could lead to unfortunate bugs. In addition, adding more members or moving around existing ones might change their values.</p>
<p>This rule raises an issue whenever an enum assigns a subset of its members, unless the first member only is assigned a numerical literal.</p>
<pre>
enum Key {
    Up = 1,
    Down,
    Left,
    Right
}
</pre>
<h2>How to fix it</h2>
<p>Either assign a value to all enum members or none of them, or assign a number literal to the first enum member only.</p>
<h3>Code examples</h3>
<h4>Noncompliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
enum Digit {
   Zero,
   One,
   ...
   Nine = 9
}
</pre>
<h4>Compliant solution</h4>
<pre data-diff-id="1" data-diff-type="compliant">
enum Digit {
    Zero,
    One,
    ...
    Nine
}
</pre>
<h4>Noncompliant code example</h4>
<pre data-diff-id="2" data-diff-type="noncompliant">
enum RGB {
   Red,
   Green,
   Blue = 0b000000000000000011111111
}
</pre>
<h4>Compliant solution</h4>
<pre data-diff-id="2" data-diff-type="compliant">
enum RGB {
   Red   = 0b111111110000000000000000,
   Green = 0b000000001111111100000000,
   Blue  = 0b000000000000000011111111
}
</pre>
<h2>Resources</h2>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://typescript-eslint.io/">typescript-eslint</a> - Rule <a
  href="https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-enum-initializers.mdx">prefer-enum-initializers</a> </li>
  <li> TypeScript Documentation - <a href="https://www.typescriptlang.org/docs/handbook/enums.html">Enums</a> </li>
</ul>
